<%@ page language="java" import="java.util.*,com.hibernate.model.Basicinfo,com.servlet.util.User_info_getName,java.text.SimpleDateFormat" pageEncoding="UTF-8"%>

  <script src="/stusys/js/user_info.js" type="text/javascript"></script>   
  <link rel="stylesheet" type="text/css" href="/stusys/css/user_info.css">
 
  	<%
  	  Basicinfo info=(Basicinfo)request.getAttribute("user_info");
  	    String birthday=info.getBirthday();
  	   String year="--";
       String month="--";
       String day="--";
      if(birthday!=null)
       {
        if( birthday.indexOf("/")>0&&birthday.lastIndexOf("/")>birthday.indexOf("/"))
        { year=birthday.substring(0,  birthday.indexOf("/"));
         month=birthday.substring( birthday.indexOf("/")+1,  birthday.lastIndexOf("/"));
         day=birthday.substring( birthday.lastIndexOf("/")+1, birthday.length()); }      
       }  
  	  User_info_getName value=new User_info_getName();   
  	  Date tm=null;
  	  SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  	  	 String time=null; 
  	if( (tm= info.getRegtime())!=null)
  	       time=in.format(tm);
  	  %>
 
   <div class="title_tip">会员中心</div>
   <div class="info_content" >    
     <div class="info_ct">  
        
   <div class="info_title" >
      <ul>
      <li class="pp_wk" id="pp_info">基本信息</li>
      <li class="pp_wk" id="set_pw">密码修改</li>
    
     </ul></div>
     
      <div id="pp_info_ct" class="ct_tsfor" >      
        <div class="info_main">
        
        <table class="table_left">
         <tr>
          <td>用户名</td>
          <td><%=value.getName(info.getId()) %></td>
         </tr>
          <tr>
          <td>身份</td>
          <td><%=value.getName(info.getStatus()) %></td>
         </tr>
         
          <tr>
          <td>学号</td>
          <td><input type="text" id="stuid" value="<%=value.getName(info.getStuid()) %>"/></td>
         </tr>
          <tr>
          <td>姓名</td>
          <td><input type="text" id="name_value" value="<%=value.getName(info.getName()) %>"/></td>
         </tr>
         
        </table>
        <table class="table_left" id="table_two">
        <tr>
            <td>注册时间</td>
            <td><%=value.getName(time) %></td>
          </tr>
          <tr>
            <td>上次登录IP</td>
            <td><%=value.getName(info.getLastip()) %></td>
          </tr>
          
        </table>
      </div>
      <div class="info_two" id="if_two">
         <table>
         
          <tr>
          <td>性别</td>
          <td><%if(value.getName(info.getGender()).equals("female")){ %>
            <input type="radio" id="female" name="gender"value="female" checked="checked"/> 女
            <input type="radio" id="male" name="gender" value ="male" /> 男
          <%} else{%>
            <input type="radio" id="female" name="gender"value="female"/>女
            <input type="radio" id="male" name="gender"value ="male"  checked="checked"/>男
          <%} %>
          </td>
         </tr>
       <tr>
          <td>年级</td>
          <td><select size="1" id="grade" name="<%=value.getName(info.getGrade()) %>">
          
             </select>
          </td>
       </tr>
        <tr>
          <td>系别</td>
          <td>
          <select size="1" id="dept">
               <option value="<%=value.getName(info.getDept()) %>"><%=value.getName(info.getDept()) %></option>
             </select>
          </td>
       </tr>
        <tr>
          <td>专业</td>
          <td>
          <select size="1" id="profs">
               <option value="<%=value.getName(info.getProfs()) %>"><%=value.getName(info.getProfs()) %></option>
             </select>
          
          </td>
       </tr>
        
      </table></div>
      <div class="info_two" >
         <table id="last_table">
         <tr>
          <td>地址</td>
          <td><input type="text" id="addr" value="<%=value.getName(info.getAddress()) %>"/></td>
       </tr>
      <tr>
          <td>生日</td>
          <td>
          <select size="1" id="year" name="<%=year %>">  
          </select>
          <select size="1" id="month" name="<%=month %>">          
          </select>
          <select size="1" id="day" name="<%=day %>">          
          </select>
          </td>
       </tr>
           <tr>
            <td>邮箱</td>
            <td><input type="text" id="email" value="<%=value.getName(info.getEmail()) %>"/></td>
          </tr>
          <tr>
            <td>QQ</td>
            <td><input type="text" id="qq" value="<%=value.getName(info.getQq()) %>"/></td>
          </tr>
          
         </table>
         
       <div class="save_bs_info"><div id="save_bs"></div><div class="save_load">loading</div></div>
         
      </div>
   
       </div> <!-- id=pp_info_ct -->
       
     
      <div  class="ct_tsfor" id="set_pw_ct">
       <table>
        <tr>
         <td>原始密码：</td>
         <td><input id="old_pw" type="password" /><span class="pw_cue">密码不正确</span></td>
        </tr>
        <tr>
         <td>新密码：</td>
         <td><input id="new_pw" type="password" /><span class="pw_cue">密码低于六位</span></td>
        </tr>
        <tr>
         <td>确认密码：</td>
         <td><input id="pw_affim" type="password" /><span class="pw_cue">密码与上一次不同</span></td>
        </tr>
       </table>
      <div class="save_pw"><div id="confirm"></div><div class="save_load" >loading</div></div>
      </div><!-- id= set_pw_ct --> 
      
    </div>
       <div class="head_img">
       <div id="hdimg"><img src="/stusys/image/head.jpg"/> </div>
       <div id="name_lb"><%=value.getName(info.getId()) %></div>	
       <div id="fix">
        <a href="#">编辑头像</a>
     
       </div>
      </div>
    </div>
        